Skip to content

Add logic to avoid conficts between the enum class and variants class names#1056

Merged
sugmanue merged 2 commits intosmithy-lang:mainfrom
sugmanue:sugmanue/fix-enum-inner-type-conflicts
Mar 9, 2026
Merged

Add logic to avoid conficts between the enum class and variants class names#1056
sugmanue merged 2 commits intosmithy-lang:mainfrom
sugmanue:sugmanue/fix-enum-inner-type-conflicts

Conversation

@sugmanue
Copy link
Contributor

@sugmanue sugmanue commented Mar 9, 2026

Issue #, if available:

Description of changes:

If an enum has a name that ends of the form Type and a variant that has the name a conflict of names is created: the inner class representing the variant will have the same name of the enum itself, e.g.,

enum TextType {
  TEXT
}

To avoid the conflict, we changed the logic to add another suffix "Value" to the variant class name.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@sugmanue sugmanue enabled auto-merge (squash) March 9, 2026 16:18
Copy link
Contributor

@rhernandez35 rhernandez35 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, I wonder how many other instances of this problem we have in the generator

@sugmanue sugmanue merged commit e1e1249 into smithy-lang:main Mar 9, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants